// Upgrade NOTE: commented out 'float4x4 _World2Object', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Legacy Shaders/Transparent/Specular" {
Properties {
 _Color ("Main Color", Color) = (1,1,1,1)
 _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,0)
 _Shininess ("Shininess", Range(0.01,1)) = 0.078125
 _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" { }
}
SubShader { 
 LOD 300
 Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
  ZWrite Off
  Blend SrcAlpha OneMinusSrcAlpha
  ColorMask RGB
  GpuProgramID 19099
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_SHAr;
//uniform float4 unity_SHAg;
//uniform float4 unity_SHAb;
//uniform float4 unity_SHBr;
//uniform float4 unity_SHBg;
//uniform float4 unity_SHBb;
//uniform float4 unity_SHC;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _MainTex_ST;
//uniform float3 _WorldSpaceCameraPos;
//uniform float4 _WorldSpaceLightPos0;
uniform float4 _LightColor0;
uniform float4 _SpecColor;
uniform sampler2D _MainTex;
uniform float4 _Color;
uniform float _Shininess;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float3 xlv_TEXCOORD3 :TEXCOORD3;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float3 tmpvar_2;
    float4 v_3;
    v_3.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_3.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_3.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_3.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_4;
    v_4.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_4.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_4.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_4.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_5;
    v_5.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_5.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_5.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_5.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_6;
    tmpvar_6 = normalize((((v_3.xyz * in_v.normal.x) + (v_4.xyz * in_v.normal.y)) + (v_5.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_6;
    tmpvar_2 = worldNormal_1;
    float3 normal_7;
    normal_7 = worldNormal_1;
    float4 tmpvar_8;
    tmpvar_8.w = 1;
    tmpvar_8.xyz = float3(normal_7);
    float3 res_9;
    float3 x_10;
    x_10.x = dot(unity_SHAr, tmpvar_8);
    x_10.y = dot(unity_SHAg, tmpvar_8);
    x_10.z = dot(unity_SHAb, tmpvar_8);
    float3 x1_11;
    float4 tmpvar_12;
    tmpvar_12 = (normal_7.xyzz * normal_7.yzzx);
    x1_11.x = dot(unity_SHBr, tmpvar_12);
    x1_11.y = dot(unity_SHBg, tmpvar_12);
    x1_11.z = dot(unity_SHBb, tmpvar_12);
    res_9 = (x_10 + (x1_11 + (unity_SHC.xyz * ((normal_7.x * normal_7.x) - (normal_7.y * normal_7.y)))));
    float _tmp_dvx_95 = max(((1.055 * pow(max(res_9, float3(0, 0, 0)), float3(0.4166667, 0.4166667, 0.4166667))) - 0.055), float3(0, 0, 0));
    res_9 = float3(_tmp_dvx_95, _tmp_dvx_95, _tmp_dvx_95);
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_TEXCOORD1 = tmpvar_2;
    out_v.xlv_TEXCOORD2 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    out_v.xlv_TEXCOORD3 = max(float3(0, 0, 0), res_9);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float3 tmpvar_3;
    float3 worldViewDir_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = _WorldSpaceLightPos0.xyz;
    lightDir_5 = tmpvar_6;
    float3 tmpvar_7;
    tmpvar_7 = normalize((_WorldSpaceCameraPos - in_f.xlv_TEXCOORD2));
    worldViewDir_4 = tmpvar_7;
    tmpvar_3 = in_f.xlv_TEXCOORD1;
    float3 tmpvar_8;
    float4 tmpvar_9;
    tmpvar_9 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
    tmpvar_8 = (tmpvar_9.xyz * _Color.xyz);
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    float3 viewDir_10;
    viewDir_10 = worldViewDir_4;
    float4 c_11;
    float4 c_12;
    float nh_13;
    float diff_14;
    float tmpvar_15;
    tmpvar_15 = max(0, dot(tmpvar_3, tmpvar_2));
    diff_14 = tmpvar_15;
    float tmpvar_16;
    tmpvar_16 = max(0, dot(tmpvar_3, normalize((tmpvar_2 + viewDir_10))));
    nh_13 = tmpvar_16;
    float y_17;
    y_17 = (_Shininess * 128);
    float tmpvar_18;
    tmpvar_18 = (pow(nh_13, y_17) * tmpvar_9.w);
    c_12.xyz = (((tmpvar_8 * tmpvar_1) * diff_14) + ((tmpvar_1 * _SpecColor.xyz) * tmpvar_18));
    c_12.w = (tmpvar_9.w * _Color.w);
    c_11.w = c_12.w;
    c_11.xyz = (c_12.xyz + (tmpvar_8 * in_f.xlv_TEXCOORD3));
    out_f.color = c_11;
    return out_f;
}


ENDCG

}
 Pass {
  Name "FORWARD"
  Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
  ZWrite Off
  Blend SrcAlpha One
  ColorMask RGB
  GpuProgramID 97255
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
uniform float4 _MainTex_ST;
//uniform float3 _WorldSpaceCameraPos;
//uniform float4 _WorldSpaceLightPos0;
uniform float4 _LightColor0;
uniform float4 _SpecColor;
uniform sampler2D _LightTexture0;
uniform float4x4 unity_WorldToLight;
uniform sampler2D _MainTex;
uniform float4 _Color;
uniform float _Shininess;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float3 xlv_TEXCOORD1 :TEXCOORD1;
    float3 xlv_TEXCOORD2 :TEXCOORD2;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 worldNormal_1;
    float3 tmpvar_2;
    float4 v_3;
    v_3.x = conv_mxt4x4_0(unity_WorldToObject).x;
    v_3.y = conv_mxt4x4_1(unity_WorldToObject).x;
    v_3.z = conv_mxt4x4_2(unity_WorldToObject).x;
    v_3.w = conv_mxt4x4_3(unity_WorldToObject).x;
    float4 v_4;
    v_4.x = conv_mxt4x4_0(unity_WorldToObject).y;
    v_4.y = conv_mxt4x4_1(unity_WorldToObject).y;
    v_4.z = conv_mxt4x4_2(unity_WorldToObject).y;
    v_4.w = conv_mxt4x4_3(unity_WorldToObject).y;
    float4 v_5;
    v_5.x = conv_mxt4x4_0(unity_WorldToObject).z;
    v_5.y = conv_mxt4x4_1(unity_WorldToObject).z;
    v_5.z = conv_mxt4x4_2(unity_WorldToObject).z;
    v_5.w = conv_mxt4x4_3(unity_WorldToObject).z;
    float3 tmpvar_6;
    tmpvar_6 = normalize((((v_3.xyz * in_v.normal.x) + (v_4.xyz * in_v.normal.y)) + (v_5.xyz * in_v.normal.z)));
    worldNormal_1 = tmpvar_6;
    tmpvar_2 = worldNormal_1;
    out_v.vertex = UnityObjectToClipPos(in_v.vertex);
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.xlv_TEXCOORD1 = tmpvar_2;
    out_v.xlv_TEXCOORD2 = mul(unity_ObjectToWorld, in_v.vertex).xyz;
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float3 tmpvar_1;
    float3 tmpvar_2;
    float3 tmpvar_3;
    float3 worldViewDir_4;
    float3 lightDir_5;
    float3 tmpvar_6;
    tmpvar_6 = normalize((_WorldSpaceLightPos0.xyz - in_f.xlv_TEXCOORD2));
    lightDir_5 = tmpvar_6;
    float3 tmpvar_7;
    tmpvar_7 = normalize((_WorldSpaceCameraPos - in_f.xlv_TEXCOORD2));
    worldViewDir_4 = tmpvar_7;
    tmpvar_3 = in_f.xlv_TEXCOORD1;
    float4 tmpvar_8;
    tmpvar_8 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
    float4 tmpvar_9;
    tmpvar_9.w = 1;
    tmpvar_9.xyz = in_f.xlv_TEXCOORD2;
    float3 tmpvar_10;
    tmpvar_10 = mul(unity_WorldToLight, tmpvar_9).xyz;
    float tmpvar_11;
    tmpvar_11 = dot(tmpvar_10, tmpvar_10);
    float tmpvar_12;
    tmpvar_12 = tex2D(_LightTexture0, float2(tmpvar_11, tmpvar_11)).w;
    tmpvar_1 = _LightColor0.xyz;
    tmpvar_2 = lightDir_5;
    tmpvar_1 = (tmpvar_1 * tmpvar_12);
    float3 viewDir_13;
    viewDir_13 = worldViewDir_4;
    float4 c_14;
    float4 c_15;
    float nh_16;
    float diff_17;
    float tmpvar_18;
    tmpvar_18 = max(0, dot(tmpvar_3, tmpvar_2));
    diff_17 = tmpvar_18;
    float tmpvar_19;
    tmpvar_19 = max(0, dot(tmpvar_3, normalize((tmpvar_2 + viewDir_13))));
    nh_16 = tmpvar_19;
    float y_20;
    y_20 = (_Shininess * 128);
    float tmpvar_21;
    tmpvar_21 = (pow(nh_16, y_20) * tmpvar_8.w);
    c_15.xyz = (((tmpvar_8.xyz * _Color.xyz) * (tmpvar_1 * diff_17)) + ((tmpvar_1 * _SpecColor.xyz) * tmpvar_21));
    c_15.w = (tmpvar_8.w * _Color.w);
    c_14.w = c_15.w;
    c_14.xyz = c_15.xyz;
    out_f.color = c_14;
    return out_f;
}


ENDCG

}
}
Fallback "Legacy Shaders/Transparent/VertexLit"
}